/******************************************************************************
Copyright:
2009 Jens Collin (jens.collin@dinomin.com)

This file is part of Envox Decompiler.

Envox Decompiler is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Envox Decompiler is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with KitchenOS.  If not, see <http://www.gnu.org/licenses/>.

******************************************************************************/
using System;
using System.Diagnostics;

namespace EnvoxDecompiler
{
	/// <summary>
	/// Summary description for Trace.
	/// </summary>
	public sealed class Trace
	{

		private static Trace instance = new Trace();
		
		public static Trace Instance 
		{
			get 
			{
				return instance;
			}
		}


		private Trace()
		{
		}

		private void DoTrace(string data)
		{

		}

		public static void Debug(string data)
		{
			if (Settings.TRACE_LEVEL.DEBUG <= Settings.Instance.traceLevel)
			{
				System.Console.WriteLine("DEBUG: "+data);
				System.Diagnostics.Debug.WriteLine("DEBUG: "+data);
			}
		}

		public static void Debug(Exception e)
		{
			if (Settings.TRACE_LEVEL.DEBUG <= Settings.Instance.traceLevel)
			{
				System.Console.WriteLine("DEBUG: "+e.ToString());
				System.Diagnostics.Debug.WriteLine("DEBUG: "+e.ToString());
			}
		}


		public static void Info(string data)
		{
			if (Settings.TRACE_LEVEL.INFO <= Settings.Instance.traceLevel)
			{
				System.Console.WriteLine("INFO: "+data);
				System.Diagnostics.Debug.WriteLine("INFO: "+data);
			}
		}

		public static void Error(string data)
		{
			if (Settings.TRACE_LEVEL.ERROR <= Settings.Instance.traceLevel)
			{
				System.Console.WriteLine("ERROR: "+data);
				System.Diagnostics.Debug.WriteLine("ERROR: "+data);
			}
		}


	}
}
